﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WriteReview.aspx.cs" Inherits="CNVP.JShop.Web.Controls.WriteReview" %>

<html>
<head>
    <title>产品评论</title>
    <script src="../Scripts/jquery.js" type="text/javascript"></script>
    <script src="../Scripts/ratingsys.js" type="text/javascript"></script>
    <style type="text/css">
        body
        {
            font-family: Verdana, '宋体';
            font-size: 12px;
            margin: 0px;
            padding: 0px;
        }
        table, td
        {
            font-family: Verdana, '宋体';
            font-size: 12px;
        }
        a
        {
            text-decoration: none;
            color: #F00;
        }
        .button
        {
            width: 70px;
            height: 28px;
        }
        #rateStatus{float:left; clear:both; width:100%; height:20px;}
		#rateMe{ clear:both; width:100%;  padding:0px; margin:0px;}
		#rateMe li{float:left;list-style:none;}
		#rateMe li a:hover,
		#rateMe .on{background:url(/images/star_on.gif) no-repeat;width:12px;height:12px;}
		#rateMe a{float:left;background:url(/images/star_off.gif) no-repeat;width:12px; height:12px;}
		#ratingSaved{display:none;}
		.saved{color:red; }
    </style>
    
</head>
<body>
    <form id="form1" name="form1" method="post" runat="server" onsubmit="return CheckForm();">
    <table width="450" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr id="OrderProductName" runat="server" visible="false">
            <td height="50" >产品名称</td>
            <td>
                <asp:Literal ID="LiterProductName" runat="server"></asp:Literal></td>
        </tr>
        <tr>
            <td width="100" height="30">
                评分(*)：
            </td>
            <td width="350" height="30">
                <input type="hidden" id="rateStatus" name="rateStatus" value="0" />
                <span id="ratingSaved">评分结果!</span> 
                <div id="rateMe" title="0">
                    <a onclick="rateIt(this)" id="_1" title="1" onmouseover="rating(this)" onmouseout="off(this)"></a>
                    <a onclick="rateIt(this)" id="_2" title="2" onmouseover="rating(this)" onmouseout="off(this)"></a>
                    <a onclick="rateIt(this)" id="_3" title="3" onmouseover="rating(this)" onmouseout="off(this)"></a>
                    <a onclick="rateIt(this)" id="_4" title="4" onmouseover="rating(this)" onmouseout="off(this)"></a>
                    <a onclick="rateIt(this)" id="_5" title="5" onmouseover="rating(this)" onmouseout="off(this)"></a>
                </div>
            </td>
        </tr>
        <tr>
            <td width="100" height="30">
                主题(*)：
            </td>
            <td width="350" height="30">
                <asp:TextBox ID="txtReviewTitle" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px"
                    MaxLength="50" Width="160px" Height="25px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                评论内容(不能超过500字，请自觉遵守互联网相关政策法规)<br />
                <textarea id="ReviewContent" rows="5" cols="165" name="ReviewContent" style="width: 330px;
                    height: 80px" runat="server"></textarea>
            </td>
        </tr>
        <tr>
            <td height="35" colspan="2">
                <asp:Button ID="submit" runat="server" Text="发表评论" CssClass="button" OnClick="submit_Click" />&nbsp;&nbsp;<input
                    type="button" name="button" id="button" value="查看评论" class="button" onclick="window.location.href='GetReviewList.aspx?ID=<%=productId%>';" />
            </td>
        </tr>
    </table>
    </form>
    <script language="javascript" type="text/javascript">
        function CheckForm() {
            if ($('#rateStatus').val() == "0") {
                alert("请选择评分。");
                $('#rateStatus').focus();
                return false;
            }
            if ($('#txtReviewTitle').val() == "") {
                alert("主题不能为空。");
                $('#ReviewName').focus();
                return false;
            }
            if ($('#ReviewContent').val() == "") {
                alert("评论内容不能为空。");
                $('#ReviewContent').focus();
                return false;
            }
            return true;
        }
    </script>
</body>
</html>
